/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * MainWindow.java
 *
 * Created on Jun 12, 2011, 10:45:01 AM
 */

package ocs.gui;

import java.awt.BorderLayout;
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import java.awt.GridLayout;
import java.awt.Insets;
import javax.swing.AbstractListModel;
import javax.swing.BorderFactory;
import javax.swing.BoxLayout;
import javax.swing.JButton;
import javax.swing.JCheckBox;
import javax.swing.JLabel;
import javax.swing.JList;
import javax.swing.JPanel;
import javax.swing.JPasswordField;
import javax.swing.JProgressBar;
import javax.swing.JScrollPane;
import javax.swing.JTabbedPane;
import javax.swing.JTextArea;
import javax.swing.JTextField;
import javax.swing.SwingConstants;
import javax.swing.WindowConstants;

/**
 *
 * @author Raph
 */
public class MainWindow extends javax.swing.JFrame {

    /** Creates new form MainWindow */
    public MainWindow() {
        initComponents();
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {
        GridBagConstraints gridBagConstraints;
        JPanel jPanel12 = new JPanel();
        JTabbedPane jTabbedPane1 = new JTabbedPane();
        JPanel jPanel1 = new JPanel();
        JPanel jPanel7 = new JPanel();
        JLabel jLabel3 = new JLabel();
        JPanel jPanel4 = new JPanel();
        JPanel jPanel8 = new JPanel();
        JScrollPane jScrollPane1 = new JScrollPane();
        JPanel jPanel2 = new JPanel();
        JPanel jPanel3 = new JPanel();
        JPanel jPanel5 = new JPanel();
        JLabel jLabel1 = new JLabel();
        JLabel jLabel2 = new JLabel();
        JPanel jPanel6 = new JPanel();
        JPanel jPanel9 = new JPanel();
        JPanel jPanel10 = new JPanel();
        JLabel jLabel5 = new JLabel();
        JLabel jLabel6 = new JLabel();
        JPanel jPanel11 = new JPanel();
        JTextArea jTextArea1 = new JTextArea();

        setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
        setTitle("Ovs Calendar Synchronizer");
        setResizable(false);
        getContentPane().setLayout(new GridLayout());

        jPanel12.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10));
        jPanel12.setLayout(new BorderLayout());

        jPanel1.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10));
        jPanel1.setLayout(new GridBagLayout());

        jPanel7.setLayout(new BoxLayout(jPanel7, BoxLayout.LINE_AXIS));

        jLabel3.setText("Affiche la liste des évènement OVS futurs.");
        jPanel7.add(jLabel3);

        getEventFromOvsButton.setText("Récuperer");
        jPanel7.add(getEventFromOvsButton);

        gridBagConstraints = new GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 0;
        jPanel1.add(jPanel7, gridBagConstraints);

        jPanel4.setLayout(new GridBagLayout());
        gridBagConstraints = new GridBagConstraints();
        gridBagConstraints.fill = GridBagConstraints.HORIZONTAL;
        jPanel4.add(progressBar, gridBagConstraints);

        synchronizeButton.setText("Synchroniser");
        jPanel4.add(synchronizeButton, new GridBagConstraints());

        gridBagConstraints = new GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 3;
        gridBagConstraints.fill = GridBagConstraints.HORIZONTAL;
        gridBagConstraints.anchor = GridBagConstraints.SOUTH;
        jPanel1.add(jPanel4, gridBagConstraints);

        jPanel8.setLayout(null);
        gridBagConstraints = new GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 2;
        jPanel1.add(jPanel8, gridBagConstraints);

        eventList.setModel(new AbstractListModel() {
            String[] strings = { "Item 1", "Item 2", "Item 3", "Item 4", "Item 5" };
            public int getSize() { return strings.length; }
            public Object getElementAt(int i) { return strings[i]; }
        });
        jScrollPane1.setViewportView(eventList);

        gridBagConstraints = new GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 1;
        gridBagConstraints.fill = GridBagConstraints.HORIZONTAL;
        jPanel1.add(jScrollPane1, gridBagConstraints);

        jTabbedPane1.addTab("tab1", jPanel1);

        jPanel2.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10));
        jPanel2.setLayout(new GridBagLayout());

        jPanel3.setBorder(BorderFactory.createTitledBorder("OVS"));
        jPanel3.setLayout(new GridBagLayout());

        jPanel5.setLayout(new GridLayout(3, 2));

        jLabel1.setHorizontalAlignment(SwingConstants.RIGHT);
        jLabel1.setText("Pseudo");
        jPanel5.add(jLabel1);
        jPanel5.add(ovsLoginTextField);

        jLabel2.setHorizontalAlignment(SwingConstants.RIGHT);
        jLabel2.setText("Mot de passe");
        jPanel5.add(jLabel2);
        jPanel5.add(ovsPasswordTextField);

        jPanel6.setLayout(null);
        jPanel5.add(jPanel6);

        ovsRemeberCheckBox.setSelected(true);
        ovsRemeberCheckBox.setText("Mémoriser");
        jPanel5.add(ovsRemeberCheckBox);

        gridBagConstraints = new GridBagConstraints();
        gridBagConstraints.insets = new Insets(1, 0, 0, 0);
        jPanel3.add(jPanel5, gridBagConstraints);

        gridBagConstraints = new GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 1;
        gridBagConstraints.fill = GridBagConstraints.HORIZONTAL;
        jPanel2.add(jPanel3, gridBagConstraints);

        jPanel9.setBorder(BorderFactory.createTitledBorder("Google"));
        jPanel9.setLayout(new GridBagLayout());

        jPanel10.setLayout(new GridLayout(3, 2));

        jLabel5.setHorizontalAlignment(SwingConstants.RIGHT);
        jLabel5.setText("E-Mail");
        jPanel10.add(jLabel5);
        jPanel10.add(googleLoginTextField);

        jLabel6.setHorizontalAlignment(SwingConstants.RIGHT);
        jLabel6.setText("Mot de passe");
        jPanel10.add(jLabel6);
        jPanel10.add(googlePasswordTextField);

        jPanel11.setLayout(null);
        jPanel10.add(jPanel11);

        googleRemeberCheckBox.setSelected(true);
        googleRemeberCheckBox.setText("Mémoriser");
        jPanel10.add(googleRemeberCheckBox);

        gridBagConstraints = new GridBagConstraints();
        gridBagConstraints.insets = new Insets(1, 0, 0, 0);
        jPanel9.add(jPanel10, gridBagConstraints);

        gridBagConstraints = new GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 2;
        gridBagConstraints.fill = GridBagConstraints.HORIZONTAL;
        jPanel2.add(jPanel9, gridBagConstraints);

        jTextArea1.setEditable(false);
        jTextArea1.setText("Le mot de passe et l'E-mail de google ne sont pas mémorisés.");
        gridBagConstraints = new GridBagConstraints();
        gridBagConstraints.fill = GridBagConstraints.HORIZONTAL;
        jPanel2.add(jTextArea1, gridBagConstraints);

        jTabbedPane1.addTab("Comptes", jPanel2);

        jPanel12.add(jTabbedPane1, BorderLayout.CENTER);

        getContentPane().add(jPanel12);

        pack();
    }// </editor-fold>//GEN-END:initComponents

    /**
    * @param args the command line arguments
    */
    public static void main(String args[]) {
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new MainWindow().setVisible(true);
            }
        });
    }

    // Variables declaration - do not modify//GEN-BEGIN:variables
    public final JList eventList = new JList();
    public final JButton getEventFromOvsButton = new JButton();
    public final JTextField googleLoginTextField = new JTextField();
    public final JPasswordField googlePasswordTextField = new JPasswordField();
    public final JCheckBox googleRemeberCheckBox = new JCheckBox();
    public final JTextField ovsLoginTextField = new JTextField();
    public final JPasswordField ovsPasswordTextField = new JPasswordField();
    public final JCheckBox ovsRemeberCheckBox = new JCheckBox();
    public final JProgressBar progressBar = new JProgressBar();
    public final JButton synchronizeButton = new JButton();
    // End of variables declaration//GEN-END:variables

}
